package com.kalvan.mq.consumer;

import com.demo.enums.mq.MqTopicEnum;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 消息处理器元数据
 *
 * @author chenliang
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MsgHandlerMetaData {
    /**
     * 主题和标签
     *
     * @return 消息模式
     * @see MqTopicEnum
     */
    MqTopicEnum tagEnum();

    /**
     * mq 消息模式
     *
     * @return 消息模式
     * @see MessageModel
     */
    MessageModel consumerMessageModel() default MessageModel.CLUSTERING;

    int consumerThreadMin() default 1;

    int consumerThreadMax() default 10;
}
